<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/js/prettyPhoto/prettyPhoto.css" />
<script type="text/javascript" src="<?php echo base_url('assets/js/prettyPhoto/jquery.prettyPhoto.js'); ?>"></script>
<script type="text/javascript" charset="utf-8">
  $(document).ready(function(){
    $("a[rel^='prettyPhoto']").prettyPhoto();
  });
</script>
<?php
$msgtype = $this->uri->segment(3);
?>
<div id="main-content-wrap">
	<table id="t-sm">
		<tbody>
			<tr>
				<td width="150"><span class="s-to"></span><span class="sent-k">Sent To:</span></td>
				<td><span class="sent-v"><?php echo getTotype($row['totype']); ?></span></td>
			</tr>
			<?php if($row['totype'] == 'specific'){
				$reciplist = Myuser_helper::getRecipients($row['messageid']);
			?>
			<tr>
				<td>&nbsp;</td>
				<td>
					<ul class="recip-ul">
					<?php if(!empty($reciplist)){
						foreach($reciplist as $k=>$recip){ ?>
							<li><span class="recip-ul-name"><?php echo ucfirst($recip->fname).' '.ucfirst($recip->mname).' '.ucfirst($recip->lname) ?></span>
								<span class="recip-ol-email">&lt;<?php echo $recip->email ?>&gt; </span>
							</li>
					<?php }
						} else echo 'No recipient. You might have deleted the recipient.'
					?>
					</ul>
				</td>
			</tr>
			<?php  } ?>
			<tr>
				<td><span class="da"></span><span class="sent-k">Date:</span></td>
				<td><span class="sent-v"><?php echo date('F d, Y', strtotime($row['date_added'])); ?></span></td>
			</tr>
			<tr>
				<td><span class="su"></span><span class="sent-k">Subject:</span></td>
				<td><span class="sent-v"><?php echo ucwords($row['subject']); ?></span></td>
			</tr>
		</tbody>
	</table>

<?php	if($row['type'] == 'photos'){
			$files = Myuser_helper::getFiles($row['messageid']); 	?>
			<div id="files-wrap">
				<ul id="ul-files">
					<?php if(!empty($files)){
						foreach($files as $file){
					?>
					<li><a href="<?php echo base_url().'assets/images/useruploads'.$file->path; ?>" rel="prettyPhoto[gallery1]"><img src="<?php echo base_url().'assets/images/useruploads'.$file->path; ?>" title="Lala" /></a></li>
					<?php
						}
					}
					?>
				</ul>
			</div>
<?php	} elseif($row['type'] == 'videos') {
			$files = Myuser_helper::getFiles($row['messageid']);
			$linksA = (trim($row['links'])!='') ? explode("\n", $row['links']): null;
			?>
			<div id="files-wrap">
				<ul id="ul-files">
					<?php if(!empty($files)){ ?>
					<?php	foreach($files as $file){
							?>
							<li>
								<a href="<?php echo base_url().'messages/viewVideo/'.$file->fileid ?>?ajax=true&amp;width=415&amp;height=350" rel="prettyPhoto" title="View Video">
								<img src="<?php echo base_url() ?>assets/images/video-icon.png" width="160" alt="" />
								</a>
							</li>
							<?php
						}
					}
					if(!empty($linksA)){
						foreach($linksA as $link){ ?>
							<li>
								<a href="http://www.youtube.com/watch?v=<?php echo $link ?>?rel=0" rel="prettyPhoto" title="View Video">
								<img src="http://img.youtube.com/vi/<?php echo $link ?>/1.jpg" width="160" alt="" />
								</a>
							</li>
					<?php
						}
					}
					?>
				</ul>
			</div>

<?php  } else {  ?>
			<div id="m-d">
					<?php echo $row['description']; ?>
			</div>
<?php  }  ?>

</div>
